﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hp.Vertica.Client.Internal;

namespace Hp.Vertica.Client.Internal
{
    public class Column
    {
        public String Name { get; set; }
        public VerticaDataType DataType { get; set; }
        public Boolean IsNullable { get; set; }
        public Boolean IsIdentity { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(this.Name);
            sb.Append(" ");
            if (IsIdentity)
            {
                sb.Append(" IDENTITY");
            }
            else
            {
                sb.Append(this.DataType);
                if (IsNullable)
                {
                    sb.Append(" NULL");
                }
                else
                {
                    sb.Append(" NOT NULL");
                }
            }
            return sb.ToString();
        }
    }
}
